import random
def fun_list(f_num,f_list=[]):
    for i in range(0,f_num):
        f_list.append(int(random.random()*100))
    print('随机生成列表 ===>>>',f_list)
    return f_list

def max_min(l_len):         
    i = 0                                      
    sort_list = fun_list(l_len)

    for j in range(1,l_len):           
        if sort_list[i] > sort_list[j]:                          
            sort_list[i],sort_list[j] = sort_list[j],sort_list[i]  
        if sort_list[l_len-1] < sort_list[l_len-1-j] and j < l_len:                          
            sort_list[l_len-1],sort_list[l_len-1-j] = sort_list[l_len-1-j],sort_list[l_len-1]
        j = j + 1                        
    print("Max is : ",sort_list[l_len-1])
    print("Min is : ",sort_list[0])

max_min(10)
